package com.example.ch03;

import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.*;

public class AutoGeneratorUtil {

    public static void main(String[] args) {
        AutoGenerator autoGenerator = new AutoGenerator(new DataSourceConfig.Builder(
                "jdbc:mysql://localhost:3306/crm?serverTimezone=GMT-8&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai",
                "root",
                "root").build());
        autoGenerator.global(new GlobalConfig.Builder().outputDir("D:\\work\\S3\\Spring-Boot\\spring-boot\\ch07\\src\\main\\java").author("caozhiren").build());
        autoGenerator.packageInfo(new PackageConfig.Builder("com.example","ch07").build());
        autoGenerator.strategy(new StrategyConfig.Builder().build());
        autoGenerator.template(new TemplateConfig.Builder().controller("templates/controller.java").build());
        autoGenerator.execute();
    }

}
